﻿/***************************************************************************
*		功能：     收入支出项目实体类(代码生成工具搞定的)
*		作者：     Sands
*		日期：     2012-09-08 06:26
*		
*		修改日期：
*		修改人：
*		修改内容：
/* *************************************************************************/
using System;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.IO;
using System.Text;
using System.Data;
using Sands.DataAccess;
using Sands.Common;
using System.Collections.Generic;
using System.Linq;
namespace SAWeb.Model
{
	/// <summary>
	/// 收入支出项目
	/// </summary>
	[Serializable]
	[HTable( TableName = "Project" ,  Remake = "收入支出项目")]
	public partial class Project :  IModel 
	{
        /// <summary>
        /// 是否新参数
        /// </summary>
        public bool IsNewModel() { return Project == 0; } 

	    
		/// <summary>
		/// 项目ID
		/// </summary>
		[HColumn( Remake = "项目ID" ,  IsPrimary = true ,  IsIdentity = true)]
		public int Project { set; get; }
        

		/// <summary>
		/// 用户ID
		/// </summary>
		[HColumn( Remake = "用户ID")]
		public int UsesrId { set; get; }
        

		/// <summary>
		/// 项目名称
		/// </summary>
		[HColumn( Remake = "项目名称" ,  Length = 200 ,  IsNullable = true)]
		public string Name { set; get; }
        

		/// <summary>
		/// 项目类型
		/// </summary>
		[HColumn( Remake = "项目类型")]
		public bool IsGet { set; get; }
        

		/// <summary>
		/// 备注
		/// </summary>
		[HColumn( Remake = "备注" ,  Length = 500 ,  IsNullable = true)]
		public string Remark { set; get; }
        

		
		
        
		private Lazy<Users> _Usesr;
        [NotColumn]
		public  Lazy<Users> Usesr 
		{ 
			get
			{
				if (_Usesr.IsNotNull()) return _Usesr;
				else
				{
					_Usesr = new Lazy<Users>(() => { return new BaseService<Users>().GetModelById(UsesrId); });
					return _Usesr;
				}			
			}
		}
		


		
	}

	public partial class Db
	{
			public static class Project 
			{

				static  Project ()
				{
				 
					Project = new Field("Project","Project");
				 

					UsesrId = new Field("Project","UsesrId");
				 

					Name = new Field("Project","Name");
				 

					IsGet = new Field("Project","IsGet");
				 

					Remark = new Field("Project","Remark");
				 

				}
    			 
				 /// <summary>
				 /// 项目ID
				 /// </summary>
				 public static Field Project { private set;get; }
	    		 

				 /// <summary>
				 /// 用户ID
				 /// </summary>
				 public static Field UsesrId { private set;get; }
	    		 

				 /// <summary>
				 /// 项目名称
				 /// </summary>
				 public static Field Name { private set;get; }
	    		 

				 /// <summary>
				 /// 项目类型
				 /// </summary>
				 public static Field IsGet { private set;get; }
	    		 

				 /// <summary>
				 /// 备注
				 /// </summary>
				 public static Field Remark { private set;get; }
	    		 

			}
	}
}